package comp.movel.ubiqua.ws;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class JogadorWSDL implements KvmSerializable{
	public String nome;
	public int pontuacao;
	public JogadorWSDL(){}
	public JogadorWSDL(String nome, int pont){
		this.nome = nome;
		pontuacao = pont;
	}
	public Object getProperty(int arg0) {
		if(arg0 == 0)
			return nome;
		else if(arg0==1)
			return pontuacao;
		else
			return null;
	}

	public int getPropertyCount() {
		return 2;
	}

	public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) {
		if(arg0==0){
			arg2.name = "nome";
			arg2.type = PropertyInfo.STRING_CLASS;
		}else if(arg0 ==1){
			arg2.name = "pontuacao";
			arg2.type = PropertyInfo.INTEGER_CLASS;
		}
		
	}

	public void setProperty(int arg0, Object arg1) {
		if(arg0==0)
			nome = arg1.toString();
		else if(arg0==1)
			pontuacao = Integer.parseInt(arg1.toString());
	}
}
